var defaultPage='slave3';
export default{
  data(){
    return{
    };
  },
  methods:{
    openDefaultPage(){
    }
  },
  beforeRouteUpdate(to,from,next){
    console.log('决定跳转到子页面？',to);
    if(!to.meta.permission){
      next(`/routerGuard/${defaultPage}`);
      return;
    }
    if(2==to.meta.permission){
      console.log('2号子页面无权限访问');
      return;
    }
    next();
  },
  beforeRouteEnter(to,from,next){
    console.log('加载权限信息');
    setTimeout(()=>{
      console.log('决定跳转到子页面0？',to);
      if(!to.meta.permission){
        next(`/routerGuard/${defaultPage}`);
        return;
      }
      if(2==to.meta.permission){
        console.log('2号子页面无权限访问0');
        next(`/routerGuard/${defaultPage}`);
        return;
      }
      next();
    },1000);
  },
  beforeRouteLeave(to,from,next){
    console.log('离开框架');
    next();
  }
}

